package exception;

import javax.jws.soap.SOAPBinding;
import java.io.FileNotFoundException;

/** 异常的抛出 */
public class ThrowDemo {
    public static void main(String[] args) {
        Student zs = new Student();
        try {
            zs.setAge(1000);
            System.out.println("此人岁数："+zs.getAge());
        } catch ( IllegalAgeException e) {
            System.out.println("年龄非法发生异常，并处理了");
        }
    }
}

